#include <p18cxxx.h>
#include "datatypes.h"

void sendEMStel() {
}

/*
 * wait until TXIF is set (TXREG is free) befor transmitting byte.
 */
void waitTxEMS() {
	while(TXSTAbits.TRMT == 1);
}

/*
 *
 */
void transmitEMS(unsigned char byte) {
	TXREG = byte;
}

/*
 *
 */
unsigned char receiveEMS() {
	return RCREG;
}

/*
 * Wait until USART has received Data
 */
void waitRxEMS() {
	while(PIR1bits.RCIF == 0);
}
